//
//  MineBottomTableViewCell.m
//  ZYZB
//
//  Created by ENERGY on 2018/7/5.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "MineBottomTableViewCell.h"
@interface MineBottomTableViewCell()
@property (nonatomic, strong)UILabel * titleLab;//标题
@property (nonatomic, strong)UIButton * arrowBtn;//箭头
@end
@implementation MineBottomTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        __weak typeof (self)weakSelf = self;
        [self.contentView addSubview:self.titleLab];
        [self.contentView addSubview:self.arrowBtn];
        UIView * lineView = [[UIView alloc] init];
        lineView.backgroundColor = getColor(borderColor);
        [self.contentView addSubview:lineView];
        
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
            make.top.equalTo(weakSelf.contentView.mas_top).mas_offset(22/WIDTH_6_SCALE);
            make.bottom.equalTo(weakSelf.contentView.mas_bottom).mas_offset(-22/WIDTH_6_SCALE);
        }];
        [self.arrowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView.mas_right).mas_offset(-18/WIDTH_6_SCALE);
            make.centerY.equalTo(weakSelf.contentView.mas_centerY);
            make.height.mas_offset(12/WIDTH_6_SCALE);
            make.width.mas_offset(7/WIDTH_6_SCALE);
        }];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.contentView.mas_left).mas_offset(18/WIDTH_6_SCALE);
            make.right.equalTo(weakSelf.contentView.mas_right).mas_offset(-18/WIDTH_6_SCALE);
            make.height.mas_offset(1/WIDTH_6_SCALE);
        }];
    }return self;
}
#pragma mark - init
- (UILabel *)titleLab{
    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.font = DEF_FontSize_12;
        _titleLab.textColor = [UIColor blackColor];
        _titleLab.textAlignment = NSTextAlignmentLeft;
        _titleLab.text = @"持有中出借";
    }return _titleLab;
}
- (UIButton *)arrowBtn{
    if (!_arrowBtn) {
        _arrowBtn = [[UIButton alloc] init];
//        [_arrowBtn setBackgroundColor:[UIColor redColor]];
        [_arrowBtn setImage:[UIImage imageNamed:@"in"] forState:UIControlStateNormal];
    }
    return _arrowBtn;
}


- (void)setModel:(NSDictionary *)model{
    _model = model;
    self.titleLab.text = model[@"title"];
}
@end
